<template>
  <div class="pms-zr-tabs">
    <el-tabs v-model="activeName" type="border-card">
      <el-tab-pane label="物资绑定明细" name="material">
        <MaterialTabs v-if='activeName=="material"' ref="materialTabs" :prj-id="prjIds" />
      </el-tab-pane>
      <el-tab-pane label="服务绑定明细" name="service">
        <ServiceTabs v-if='activeName=="service"' ref="serviceTabs" :prj-id="prjIds" />
      </el-tab-pane>
    </el-tabs>
    <div class="foot-btn">
      <el-button type="primary" class="pms-button-primary" @click="handleClose">关闭</el-button>
    </div>
  </div>
</template>
<script>
import ServiceTabs from "./serviceTabs.vue";
import MaterialTabs from "./materialTabs.vue";

export default {
  name: "showMaterialService",
  components: {MaterialTabs, ServiceTabs},
  props: ['selectList'],
  data() {
    return {
      activeName: 'material',
    }
  },
  computed:{
    prjIds(){
      return this.selectList.map(item=>item.prjId).join(',')
    }
  },
  methods:{
    handleClose(){
      this.$emit('close')
    }
  }
}
</script>

<style scoped lang='scss'>
.foot-btn{
  text-align: center;
  margin-top: 20px;
}
</style>
